/**
 *
 */
package com.dhcc.frame.collection;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author 谢进军
 *
 */
public class SimpleThreadPool {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ExecutorService executor = Executors.newFixedThreadPool(5);
//		for (int i = 0; i < 10; i++) {
//			Runnable worker = new WorkerThread("" + i);
//			executor.execute(worker);
//		}
		executor.execute( new MyTimerTask() );
		executor.execute( new MyTimerTask2() );
		executor.shutdown();
		while (!executor.isTerminated()) {
		}
		System.out.println("Finished all threads");
	}

}
